package cn.edu.sgu.www.mhxysy.service.children.impl;

import cn.edu.sgu.www.mhxysy.entity.children.ChildrenSkillCategory;
import cn.edu.sgu.www.mhxysy.mapper.children.ChildrenSkillMapper;
import cn.edu.sgu.www.mhxysy.service.children.ChildrenSkillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Service
public class ChildrenSkillServiceImpl implements ChildrenSkillService {

    private final ChildrenSkillMapper childrenSkillMapper;

    @Autowired
    public ChildrenSkillServiceImpl(ChildrenSkillMapper childrenSkillMapper) {
        this.childrenSkillMapper = childrenSkillMapper;
    }

    @Override
    public List<ChildrenSkillCategory> selectByChildrenId(String childrenId) {
        List<ChildrenSkillCategory> list = childrenSkillMapper.selectByChildrenId(1, childrenId);
        List<ChildrenSkillCategory> categories = childrenSkillMapper.selectByChildrenId(2, childrenId);

        list.addAll(categories);

        return list;
    }

}